<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>体能测试</title> $!{include("import_js_css.html")}
</head>
<body>
	$!{include("header.html")}
	<div class="container" style="width: 1200px;">
		<div class="panel panel-info">
			<!--#var(Member member)-->
			$!{include("memberHeader.html")}
			<div id="div_result_member" style="padding: 15px;">
				<div class="panel">
					$!{include("member_info_tab.html")}
					<div id="div_result_member" class="panel-hxcd-info">
						<form class="form-horizontal" role="form" action="yueyogaAdmin/addtest.jhtml"
							method="post">
								<label for="inputTestPro" class="col-sm-1 control-label">测试名称</label>
								<div class="col-sm-3">
									<input type="text" class="form-control" name="selTestPro"
										id="inputTestPro" value="${testName}">
								</div>
								<label for="selPerson" class="col-sm-1 control-label">负责人</label>
								<div class="col-sm-3">
									<select class="selectpicker show-tick" data-live-search="true"
										data-width="100%" name="resporId" id="resporId" name="resporId">
										<option value=""> </option>
										<!--#for(GroupUserModel u: responsibles)-->
										<option value="${u.id}">${u.name}</option>
										<!-- #end -->
									</select>
								</div>
								<br> <br> <label for="inputResult"
									class="col-sm-1 control-label">测试结果</label>
								<div class="col-sm-7">
									<textarea class="form-control" name="result" id="inputResult"
										style="resize: none;width: 622px" rows="3" required></textarea>
								</div>
								<br /> <br /><br /><br /><br /><br />
								<div class="panel-btn-search" style="margin-bottom:10px;margin-top:-10px;">
									<button type="button"  style="margin-right:180px;" onclick="addTest()" class="btn btn-default btn-ade-default">保存</button>
								</div>
						</form>
						<!--#var(TestSection test, PaginatedList<TestSection> testSection)-->
						<!--
							#set(
							pager = testSection.pager,
							totalResults = pager.getCountOfTotalResults(),
							totalPages = pager.getCountOfTotalPages() * 1,
							pageSize = pager.pageSize,
							pageNo = pager.pageNo,
							prePageNo = pager.prevPageNo,
							nextPageNo =  pager.nextPageNo
							)
							-->
						<!--#if(totalResults== null || totalResults==0)-->
						<div class="panel-body">
							<p>没有符合条件的数据</p>
						</div>
						<!--#else-->
						<table class="table table-bordered table-hover table-condensed gzce-tb"
							style="text-align: center;">
								<tr>
									<td colspan="4">
										<div
											style="width: 400px; float: right; text-align: right; height: 25px; line-height: 25px;">
											<label class="radio-inline"> <!--#if(sortType==null || sortType=='1')-->
												<input type="radio" name="sortType" value="1" id="sortType"
												checked="checked">按时间倒序 <!--#else--> <input
												type="radio" name="sortType" value="1" id="sortType"
												onclick="onchangeSortType(1)">按时间倒序 <!--#end-->
											</label> <label class="radio-inline"> <!--#if(sortType=='0')-->
												<input type="radio" name="sortType" id="sortType" value="0"
												checked="checked">按时间正序 <!--#else--> <input
												type="radio" name="sortType" id="sortType" value="0"
												onclick="onchangeSortType(0)">按时间正序 <!--#end-->
											</label>
										</div>
									</td>
								</tr>
								<!--#foreach(test in testSection)-->
								<tr>
									<td width="160px">${test.createTime.toDate("yyyy-MM-dd HH:mm:ss")}</td>
									<td width="100px">${test.resporname}</td>
									<td width="100px">${test.name}</td>
									<td align="left"></td>
								</tr>
								<tr>
									<td colspan="4" align="left" height="70" style="padding-left:25px;">${test.result}</td>
								</tr>
								<!--#end-->
						</table>
							<!-- 列表分页 -->
							<div class="gzce-pagering">$!{include("paging_page.html")}</div>
						<!--#end-->
					</div>
				</div>
			</div>
		</div>
	</div>
		<form name="contactForm" action="yueyogaAdmin/toMemberTest.jhtml"
		method="post">
		<input name="id" type="hidden" value="${id}"> <input
			type="hidden" name="pageNo" id="hidPageNo" /> <input
			name="sortType" type="hidden" value="${sortType}">
	</form>
</body>
</html>
<script type="text/javascript">
	$("#resporId").val('${resporsId}');
	var id='${member.memberid}';
	function addTest() {
		var testPro = $("#inputTestPro").val();
		var inputResult=$("#inputResult").val();
		var resporId=$("#resporId").val();
		if (inputResult != null && inputResult != "") {
			var url = "yueyogaAdmin/addTest.jhtml";
			$.post(
				url,
				{
					id : id,
					inputResult:inputResult,
					testPro : testPro,
					resporId : resporId
				},
				function(msg) {
					if (msg == 'true') {
						location.replace(location);
					} else {
						alert("添加失败!");
					}
				});
		}else{
			alert("请填写测试结果!")
		}
	}
	function shaixuan(i) {
		var type = i;
		var sortType = $("#sortType").val();
		window.location.href = "yueyogaAdmin/toMemberTest.jhtml?id=" + id + "&sortType=" + sortType;
	}
	function onchangeSortType(i) {
		var type = $("#inputType").val();
		window.location.href = "yueyogaAdmin/toMemberTest.jhtml?id=" + id + "&sortType=" + i;
	}
	function js_method(id, val, name) {
		$("#" + id).val(val);
		$("#" + id + "s").html(name);
	}
	function goToPage(pageNo) {
		$("#hidPageNo").val(pageNo);
		document.contactForm.submit();
	}
	function changePage(value) {
		value = value * 1;
		var totalPages = '${totalPages}';
		if (value > totalPages) {
			value = totalPages;
		} else if (value < 1) {
			value = 1;
		}
		$("#txtPageNumber").val(value);
		goToPage(value);
	}
</script>